﻿using UnityEngine;
using FrameOperateSync;

namespace Pvp
{
    public class PvpInputRender : MonoBehaviour
    {
        private void Start()
        {
            // RouterUtility.RegistRenderHander(OnRender1);
            // RouterUtility.RegistRenderHander(OnRender2);
            // RouterUtility.RegistRenderHander(OnRender3);
            // RouterUtility.RegistRenderHander(OnRender4);
            // RouterUtility.RegistRenderHander(OnRender5);
        }

        [FrameRender((int)OperateType.fightOp_Move, typeof(MoveOperateData), "移动")]
        private void OnRender1(bool preFlag, int playerId, int frameIndex, IRenderData operateData)
        {
            PvpCore.ProcessInput(playerId, preFlag, OperateType.fightOp_Move, operateData);
        }

        [FrameRender((int)OperateType.fightOp_Jump, typeof(JumpOperateData), "跳跃")]
        private void OnRender2(bool preFlag, int playerId, int frameIndex, IRenderData operateData)
        {
            PvpCore.ProcessInput(playerId, preFlag, OperateType.fightOp_Jump, operateData);
        }
        
        [FrameRender((int)OperateType.fightOp_Skill, typeof(SkillOperateData), "技能")]
        private void OnRender3(bool preFlag, int playerId, int frameIndex, IRenderData operateData)
        {
            PvpCore.ProcessInput(playerId, preFlag, OperateType.fightOp_Skill, operateData);
        }
        
        [FrameRender((int)OperateType.fightOp_Button, typeof(ButtonOperateData), "界面按钮")]
        private void OnRender4(bool preFlag, int playerId, int frameIndex, IRenderData operateData)
        {
            PvpCore.ProcessInput(playerId, preFlag, OperateType.fightOp_Button, operateData);
        }
        
        [FrameRender((int)OperateType.fightOp_Stop, typeof(StopOperateData), "stop")]
        private void OnRender5(bool preFlag, int playerId, int frameIndex, IRenderData operateData)
        {
            PvpCore.ProcessInput(playerId, preFlag, OperateType.fightOp_Stop, operateData);
        }
    }
}

